<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>考勤信息统计</title>
<link rel="icon" href="<c:url value='/imgs/logo.ico' />" />
<script type="text/javascript" charset="utf-8" src="<c:url value='/scripts/jquery-2.1.0.js'/>"></script>
<style type="text/css">
	*{
		margin:0;
		padding:0;
	}
	
	body{
		background: #F2F2F2;
	}
	
	a{
		text-decoration: none;
	}
	
	ul{
		list-style: none;
	}
	
	.container{
		width:1200px;
		margin:0 auto;
		background:white;
	}
	
	.top{
		width:100%;
		padding:20px 0;
	}
	
	.top img{
		width: 400px;
		margin-left:20px;
		cursor: pointer;
	}
	
	.top .usermsg{
		float:right;
		font-size:15px;
		font-weight:bold;
		margin-top:10px;
		margin-right:100px;
	}
	
	.top .usermsg .uname{
		color: blue;
	}
	
	.top .usermsg a{
		color:red;
	}
	
	.left{
		float:left;
		width:20%;
		min-height:600px;
		background: #7F7F7F;
	}
	
	.left .mechanism{
		margin-top:40px;
		background: #66CC00;
	}
	
	.left .employee{
		background: #FF9900;
	}
	
	.left .holiday{
		background: #FFFF33;
	}
	
	.left .attend{
		background: #0099FF; 
	}
	
	.left .update{
		background: #CC33CC;
	}
	
	.left ul li{
		width:100px;
		padding: 15px 30px;
		margin-top:20px;
		text-align: center;
		border-bottom-right-radius: 30px;
		border-top-right-radius: 30px;
		box-shadow: 5px 5px 5px #535353;
		cursor: pointer;
	}
	
	.left ul:first-child{
		margin-top:40px;
	}
	
	.left ul li a{
		font-size: 18px;
		line-height: 18px;
	}
	
	.left ul li a:link{
		color:black;
	}
	
	.left ul li a:visited{
		color:black;
	}
	
	.left ul li a:hover{
		color:white;
	}
	
	.left ul li a:active{
		color:white;
	}
	
	.main{
		float: left;
		width:80%;
		min-height:600px;
		background-size: 960px 600px;
		background: #BCBCBC;
	}
	
	.main .content{
		width: 80%;
		margin:0 auto;
	}	
	
	.main .content h2{
		padding-top: 20px;
		text-align: center;
	}
	
	.main .content .export{
		float:right;
	}
	
	.main .content .listTable{
		width: 100%;
		margin: 0px auto 20px;
		font-size: 15px;
		text-align: center;
		border-collapse: collapse;
	}
	
	.main .content .errorsheet{
		margin-top:36px;
	}
	
	.main .content .listTable tr td{
		padding:5px 0;
	}
	
	.main .content .listTable .listTitle{
		font-size: 16px;
	}
	
	.main .content .errorsheet  tr td{
		border: 1px solid #0099FF;
	}
	
	.main .content .errorsheet .listTitle{
		background: #0099FF;	
	}
	
	.main .content .page{
		text-align: center;
	}
	
	.main .content .page .empty{
		color:red;
	}
</style>
</head>
<body>
	<%
        String exportToExcel = request.getParameter("exportToExcel");
        if (exportToExcel != null
                && exportToExcel.toString().equalsIgnoreCase("YES")) {
            response.setContentType("application/vnd.ms-excel");
            response.setHeader("Content-Disposition", "inline; filename="
                    + "excel.xls");
 
        }
    %>
	<div class="container">
		<%
	        if (exportToExcel == null) {
	    %>
		<%@ include file="/jsps/top.jsp"%>
		<%
			}			 
	    %>
		<div class="main">
			<div class="content">
				<%
			        if (exportToExcel == null) {
			    %>
				<h2 style="text-align:center;">考勤信息统计</h2>
 			    <a id="exporturl" href="#"><button class="export">导出excel</button></a>
<!--  			    <a id="exporturl" href="queryErrorsheet?mechid=&empid=&bdate=&edate=&type=2&exportToExcel=YES"><button class="export">导出excel</button></a> -->
			    <%
			        }
			    %>
				<table class="listTable errorsheet" style="border:1px solid #0099FF;font-size:15px;">
					<tr class="listTitle" style="font-size:16px;text-align:center;vnd.ms-excel.numberformat:@;">
						<c:if test="${sessionScope.employee.power eq '0' }">
							<td style="background: #0099FF;">工号</td>
						</c:if>
						<td style="background: #0099FF;">服务器时间</td>
						<td style="background: #0099FF;">客户端时间</td>
						<td style="background: #0099FF;">登录IP</td>
						<td style="background: #0099FF;">识别相似度</td>
						<td style="background: #0099FF;">识别结果</td>
					</tr>
					<c:forEach items="${pb.beanList }" var="flowsheet">
					<tr style="text-align:center;vnd.ms-excel.numberformat:@;">
						<c:if test="${sessionScope.employee.power eq '0' }">
							<td style="border:1px solid #0099FF;">${flowsheet.employee.empid }</td>
						</c:if>
						<td style="vnd.ms-excel.numberformat:yyyy-mm-dd hh:mm:ss;border:1px solid #0099FF;">${flowsheet.logdate } ${flowsheet.logtime }</td>
						<td style="border:1px solid #0099FF;">${flowsheet.clientdatetime }</td>
						<td style="border:1px solid #0099FF;">${flowsheet.logip }</td>
						<td style="border:1px solid #0099FF;">${flowsheet.similarity }%</td>
						<td style="border:1px solid #0099FF;">
							<c:if test="${flowsheet.result eq '1' }">	
								成功
							</c:if>
							<c:if test="${flowsheet.result eq '0' }">	
								失败
							</c:if>
						</td>
					</tr>
					</c:forEach>
				</table>
				<%
			        if (exportToExcel == null) {
			    %>
				<%@ include file="/jsps/page.jsp"%>
				<%
			        }
			    %>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$(function(){
			$(".top .title").click(function(){
				location.href="<c:url value='/index.jsp'/>";
			});	
			
		 	$(".main .content .export").click(function(){
				var nowUrl = window.location.href;
				var newUrl = nowUrl.substring(0,nowUrl.indexOf("&pc=")-1)+"2&exportToExcel=YES";
				$("#exporturl").attr("href",newUrl);
			});
		});
	</script>
</body>
</html>

